package com.zhangmeng.online.exam.entity;

import com.zhangmeng.online.exam.entity.baseEntity.BaseEntity;
import lombok.*;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

/**
 * 考试试卷的答案(参考答案)
 * @author zm
 * @date 2025/3/18 16:36
 * @version: 1.0
 */
@NoArgsConstructor
@ToString(exclude = {"answers"})
@Getter
@Setter
@AllArgsConstructor
@Entity
@Table(name = "paper_answer")
public class PaperAnswer extends BaseEntity<Long> {

    @ManyToOne(fetch = FetchType.LAZY)
    private User crateUser;//试卷答案创建者

    @OneToMany(mappedBy = "paperAnswer",fetch = FetchType.LAZY)
    private List<Answer> answers = new ArrayList<>();//试卷答案列表
}
